package com.yuanfeng.action.front.address.service;

import com.yuanfeng.action.front.address.dao.AddressDao;
import com.yuanfeng.pojo.Address;
import com.yuanfeng.action.front.address.dao.AddressDaoImpl;

import java.util.List;

public class AddressServiceImpl implements AddressService {
    /**
     * sspring 提供注入
     */
	private AddressDao addressDaoImpl;

	public void setAddressDaoImpl(AddressDaoImpl addressDaoImpl) {
		this.addressDaoImpl = addressDaoImpl;
	}

    /**
     * 增加地址
     * @param addr
     * @return
     */
	public Address add(Address addr) {
		return addressDaoImpl.add(addr);
	}

    /**
     * 改变地址
     * @param addr
     */
	public void changeToDefault(Address addr) {
		addressDaoImpl.changeToDefault(addr);
	}

    /**
     * 删除地址
     * @param addr
     */
	public void delete(Address addr) {
		addressDaoImpl.delete(addr);
	}

    /**
     * 查询地址
     * @param userId
     * @return
     */
	public List<Address> queryAddress(String userId) {
		return addressDaoImpl.queryAddress(userId);
	}

}
